import React, { Component } from 'react'
import { View, TouchableOpacity, Text, Image } from 'react-native'
import { Thumbnail } from 'native-base'
import commonStyle from '../../libs/commonStyle'
import { Actions } from 'react-native-router-flux'
import Iconfont from '../iconfont'

export default class Item extends Component {
	pressHandle() {
		Actions.adetail({
			...this.props.info,
			money: this.props.money
		})
	}
	render() {
		const info = this.props.info
		return (
			<TouchableOpacity
				activeOpacity={1}
				style={[
					commonStyle.flexRow,
					commonStyle.p20,
					commonStyle.flexJustifyBetween,
					commonStyle.borderBottom,
					commonStyle.backgroundColorWhite
				]}
				onPress={this.pressHandle.bind(this)}
			>
				<Image
					style={[commonStyle.w190, commonStyle.h150]}
					square
					source={{ uri: info.coverUrl }}
				/>
				<View style={[commonStyle.flexItem, commonStyle.pl20]}>
					<Text
						style={[
							commonStyle.f28,
							commonStyle.colorBlackLight,
							{ lineHeight: 23 }
						]}
					>
						{info.title}
					</Text>
					<View
						style={[
							commonStyle.flexRow,
							commonStyle.pt20,
							commonStyle.flexVerticalCenter,
							commonStyle.flexJustifyBetween
						]}
					>
						{/* <Text style={[commonStyle.colorGray]}>
              累计收益 {info.userId}
            </Text> */}
						<Text
							style={[
								commonStyle.activeColor,
								commonStyle.pr20,
								commonStyle.f24
							]}
						>
							点击单价{this.props.money}元
						</Text>
						<View
							style={[
								commonStyle.flexRow,
								commonStyle.flexCenter,
								commonStyle.border,
								commonStyle.w100,
								commonStyle.h50,
								// commonStyle.activeBorderColor,
								commonStyle.circle30,
								{
									borderColor: 'rgb(0, 115, 146)'
								}
							]}
						>
							<Iconfont
								name="share_line"
								style={[commonStyle.colorBlue2]}
							/>
							<Text style={[commonStyle.colorBlue2, commonStyle.f24]}>分享</Text>
						</View>
					</View>
				</View>
			</TouchableOpacity>
		)
	}
}
